package yunwo.cn.yzstation.view.fregment.carsdetail;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import java.util.HashMap;
import java.util.Map;

import yunwo.cn.yzstation.R;
import yunwo.cn.yzstation.bean.CarListBean;
import yunwo.cn.yzstation.view.activity.CarsDetailsActivity;

/**
 * Created by lao on 2017/10/13.
 */

public class CarInfoFregment extends Fragment {

    private View mRootView;
    private CarsDetailsActivity mActivity;
    private TextView mDrivername;
    private TextView mDriverphone;
    private TextView mCarnumber;
    private TextView mCartype;
    private TextView mCarobj;
    private TextView mBatch;
    private CarListBean.DataBean.ListBean mData;

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        mRootView = inflater.inflate(R.layout.fragment_carinfo, container, false);
        return mRootView;
    }

    @Override
    public void onActivityCreated(@Nullable Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
        mActivity = (CarsDetailsActivity) getActivity();
        mData = mActivity.getData();

        initView();

    }



    private void initView() {
        mBatch = (TextView) mRootView.findViewById(R.id.Batch);
        mCarobj = (TextView) mRootView.findViewById(R.id.carobj);
        mCartype = (TextView)mRootView. findViewById(R.id.cartype);
        mCarnumber = (TextView) mRootView.findViewById(R.id.carnumber);
        mDrivername = (TextView) mRootView.findViewById(R.id.drivername);
        mDriverphone = (TextView) mRootView.findViewById(R.id.driverphone);
        mBatch.setText(mData.getBatchNumber());
        mCarobj.setText(mData.getTruckTarget());
        mCartype.setText(mData.getVehicleType());
        mCarnumber.setText(mData.getPlateNumber());
        mDrivername.setText(mData.getDriverName());
        mDriverphone.setText(mData.getDriverPhone());
    }
}
